home *** CD-ROM | disk | FTP | other *** search
/ Celestin Apprentice 4 / Apprentice-Release4.iso / Utilities / Programming / Gooey 1.2 / Gooey 68K ƒ / C Templates / Common.c < prev    next >
Encoding:
Text File  |  1995-01-29  |  7.4 KB  |  122 lines  |  [TEXT/KAHL]

  1. $$Message User Common, u:common$Prototype.name$.h
  2. $$File u:common$Prototype.name$.h
  3. /*  common$Prototype.name$                         Common */
  4. /*  $CopyRight$ */
  5.  
  6. /* 
  7.     File name:  common$Prototype.name$.h   
  8.     Function:  Common variables for program specific code.
  9.     History: $Date$ Original by $Author$
  10.  
  11.    */
  12.  
  13. /* ======================================================= */
  14. /* ======================================================= */
  15.  
  16. /* NOTE : FormatRevision MUST be first in the record, and always a short */
  17. typedef struct PrefsRec{                        /* Preferences Record definition */
  18.     /* ALWAYS KEEP FormatRevision AS THE FIRST ELEMENT IN THIS RECORD */
  19.     short                    FormatRevision;        /* FIRST ALWAYS, Change each time the format changes */
  20.     WindowLocRec    theWindowLocRec;    /* For saving window positions */
  21.  
  22.     /* Add other preference variable definitions after this line */
  23.  
  24. }PrefsRec,*PrefsPRec,**PrefsHRec;
  25.  
  26. /* ======================================================= */
  27. /* ======================================================= */
  28. $$CloseFile
  29. $$Message User Common, u:common$Prototype.name$.c
  30. $$File u:common$Prototype.name$.c
  31. /*  common$Prototype.name$                         Common */
  32. /*  $CopyRight$ */
  33.  
  34. /* 
  35.     File name:  common$Prototype.name$.c   
  36.     Function:  Common variables for program specific code. 
  37.     History: $Date$ Original by $Author$
  38.  
  39.    */
  40.  
  41.  
  42. #include "mmCommon$Prototype.name$.h"    /* Common */
  43. #include "common$Prototype.name$.h"        /* Common */
  44.  
  45. /* ======================================================= */
  46. /* ======================================================= */
  47.  
  48. #define    PrefsCreator        'xxxx'                /* Creator, this has to be the same as your App */
  49. #define    PrefsType                'Pref'                /* Type, this has to match the type in your BNDL */
  50. #define    PrefsFileName        "\p$Prototype.name$ Prefs"    /* This is the name of your prefs file */
  51.  
  52. #define    PrefsFormatRevision        1                /* Change each time the format changes */
  53.  
  54. /* ======================================================= */
  55.  
  56. /* Routine: U_InitPreferences */
  57. /* Purpose: Set the default preferences */
  58.  
  59. void U_InitPreferences(void)
  60. {
  61.  
  62. }
  63.  
  64. /* ======================================================= */
  65.  
  66. /* Routine: U_GetPrefParams */
  67. /* Purpose: Get the preferences Parameters */
  68.  
  69. void U_GetPrefParams(OSType *PrefCreator,OSType *PrefType,Str255 *thePrefsFilename,long *PrefsRecSize,short *thePrefsFormatRevision)
  70. {
  71.  
  72. *PrefCreator = PrefsCreator;
  73. *PrefType = PrefsType;
  74. PStrCopy((Str255 *)PrefsFileName,thePrefsFilename);
  75. *PrefsRecSize = sizeof(PrefsRec);
  76. *thePrefsFormatRevision = PrefsFormatRevision;
  77. }
  78.  
  79. /* ======================================================= */
  80.  
  81. /* Routine: U_ReadPrefsPrivate */
  82. /* Purpose: Read the prefs ourselves */
  83.  
  84. void U_ReadPrefsPrivate(short PrefsRefNum)
  85. {
  86.  
  87. }
  88.  
  89. /* ======================================================= */
  90.  
  91. /* Routine: U_GetPreferences */
  92. /* Purpose: Get the preferences from the Prefs record already read in */
  93.  
  94. void U_GetPreferences(Handle thePrefsH)
  95. {
  96. PrefsHRec thePrefs;
  97.  
  98.  
  99. thePrefs = (PrefsHRec)thePrefsH;
  100. theWindowLocRec = (*thePrefs)->theWindowLocRec;    /* Get the window location data */
  101.  
  102. /* Use the form:  ing_Page,ThePageString);
  103.         DrawString(ThePageString);
  104.         /* END OF ADD YOUR PRINTING CODE HERE */
  105.  
  106.         PrClosePage(Printing.pPrPort);                /* Print this page */
  107.         SetPort(SavedPort);
  108.         }
  109.     while (Doing_Page < NumberOfPages);
  110.     }
  111.  
  112. CloseThePrinter();                                    /* Close the printer */
  113. SetPort(SavedPort);
  114. InitCursor();
  115. }
  116.  
  117. /* ======================================================= */
  118. /* ======================================================= */
  119. $$CloseFile
  120.  
  121.  
  122.